<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../lib/js/vue.js"></script>
</head>
<body>
  <div id="root">
<h2>当前计数内容:{{counter}}</h2>
<button @click="inc">+1</button>
<button @click="dec">-1</button>

  </div>

<script type="text/javascript">
   const vm=new Vue({
      el:'#root',
      data:function(){
        return{
          counter:100
        }
      },
      methods:{
       inc:function(){
        this.counter++
       },
       dec:function(){
        this.counter--
       }
      }
    })
  </script>
</body>
</html>